package com.lzwork.gpt.service;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.lzwork.gpt.db.entity.ApiEditEntity;
import com.lzwork.gpt.db.entity.ApiEntity;
import com.lzwork.gpt.db.entity.ApiLogEntity;
import com.lzwork.gpt.db.entity.AppEntity;
import com.lzwork.gpt.db.entity.ModelEntity;
import com.lzwork.utility.pair.StringPair;
import com.lzwork.web.data.BoolResultInfo;
import com.lzwork.web.data.CallResultInfo;

/**
 * @author LiZheng
 * @date 2023年11月23日 下午2:41:02
 */

public interface ApiDataService
{
	public String getAccessPath();

	public JSONObject apiCall(ApiEntity api, ModelEntity replaceModel, List<StringPair> paramData, boolean fullReturn,
			boolean dolog);

	public List<ModelEntity> getAllModel(int sort);

	public List<ApiEntity> getAllApi(boolean fullInfo, int sort);

	public List<ApiEntity> getAllApiInfo(int sort);

	public List<AppEntity> getAllApp(boolean fullInfo, int sort);

	public List<AppEntity> getAllAppInfo(int sort);

	public ModelEntity getModel(int id);

	public CallResultInfo<ModelEntity> makeModelEntity(ModelEntity model);

	public BoolResultInfo setModelEntity(ModelEntity model);

	public BoolResultInfo deleteModel(int id);

	public ApiEntity getApi(int id);

	public ApiEntity getApi(String apikey);
	
	public BoolResultInfo resetApiKey(int id, String apikey);

	public CallResultInfo<ApiEntity> makeApiEntity(ApiEntity api, ApiEditEntity edit);

	public BoolResultInfo setApiEntity(ApiEntity api);

	public BoolResultInfo deleteApi(int id);

	public ApiEditEntity getApiEdit(int id);

	public BoolResultInfo setApiEditEntity(ApiEditEntity api);

	public BoolResultInfo deleteApiEdit(int id);

	public AppEntity getApp(int id);

	public AppEntity getApp(String apikey);

	public CallResultInfo<AppEntity> makeAppEntity(AppEntity api);

	public BoolResultInfo setAppEntity(AppEntity api);

	public BoolResultInfo deleteApp(int id);

	public BoolResultInfo addLog(ApiLogEntity entity);

	public List<ApiLogEntity> getLogByApi(int api);

	public int getLogNumByApi(int api);

	public BoolResultInfo delLog(int api, int id);

}
